<template>
  <div>
    <!-- 头部导航栏 -->
    <users-nav></users-nav>
    <!-- 内容展示区 -->
    <users-content :userData="userData" :total="total"></users-content>
  </div>
</template>

<script>
import usersNav from "./users_nav";
import usersContent from "./users_content";
export default {
  props: {},
  data() {
    return {
      pagenum: 1,
      query: "",
      pagesize: 10,
      total:0,
      userData:[]
    };
  },
  computed: {},
  created() {
    this.getUsersData()
  },
  mounted() {},
  watch: {},
  methods: {
    async getUsersData() {
      let obj = {
        pagenum: this.pagenum,
        query: this.query,
        pagesize: this.pagesize
      };
      let { data: res} = await this.$axios.get('users',{params:obj});
      console.log(res);
      this.total = res.data.total;
      this.userData = res.data.users;
    }
  },
  components: {
    usersNav,
    usersContent
  }
};
</script >

<style scoped lang='less'>
</style>
